#ifndef __EKOS_LAYOUT_H__
#define __EKOS_LAYOUT_H__

/* The FREQ (in s^-1) for PIT, if used */
#define PIT_FREQ        100

/* EKOS remaps the irq interrupt num consecutively */
/* IRQ 0 corresponds to int IRQ_OFFSET */
#define IRQ_OFFSET      32
#define IRQ_COUNT       32

#define IRQ_TIMER        0
#define IRQ_KBD          1
#define IRQ_SCTL         2
#define IRQ_IDE         14
#define IRQ_ERROR       19
#define IRQ_SPURIOUS    31

#define EX_PAGEFAULT 14
#define EX_SYS_KILL  32

#define RM_IMAGE_PAGES ((1 << 8) + (1 << 4))

/* EKOS is currently designed for supporting 256 cpus */
#define LAPIC_COUNT   256

/* The kernel stack size per process, including the 1 page
   boundary(temp page) */
#define KSTACK_SIZE   0x4000
#define KSTACK_SHIFT  14

#define PROC_KSTACK_TOP(_pid) (KSTACK + ((_pid + 1) << KSTACK_SHIFT))

/* Number of IPS Node per process  */
#define PROC_IPS_COUNT       0x40
#define PROC_IPS_COUNT_SHIFT 6
/* IPS Reserved for system use */
#define PROC_IPS_RESERVED  4
/* IPS for process exception */
#define PROC_IPS_EX (PROC_IPS_COUNT - PROC_IPS_RESERVED)

/* Number of AccessPoint in the system */
#define IPS_AP_COUNT (1 << 14)

#define WLEVEL_USER		0
#define WLEVEL_STIMER	0
#define WLEVEL_IPS		0
#define WLEVEL_START	8
#define WLEVEL_SYSTEM	16
#define WLEVEL_EXIT     24

#include "memlayout.h"

#endif
